import { defineStore } from "pinia";
import axios from "axios";
import { nanoid } from "nanoid";
export const useTalkStore = defineStore("useTalkStore", {
  state: () => {
    return {
      storeloveTalk: [
        { id: "ftrfasdfo1", title: "今天你有点怪，哪里怪?怪好看的!" },
        { id: "ftrfasdf02", title: "草莓、蓝莓、蔓越莓，今天想我了没?" },
        { id: "ftrfasdfe3", title: "hahahahahaha" },
      ],
    };
  },
  actions: {
    async inscrement() {
      let {
        data: { content },
      } = await axios.get("https://api.uomg.com/api/rand.qinghua?format=json");
      this.storeloveTalk.push({ id: nanoid(), title: content });
    },
  },
});
